package org.jacp.demo.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Employee implements Serializable{
    /**
     * 
     */
    private static final long serialVersionUID = 8601678243970872246L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private long empid;
    @Column(length = 6)
    private String empno;

    @Column(name = "FIRSTNME", length = 30)
    private String firstName;

    @Column(name = "MIDINIT", length = 30)
    private String midInitial;

    @Column(name = "LASTNAME", length = 30)
    private String lastName;

    @Column(name = "PHONENO", length = 30)
    private String phoneNumber;

    @Column(length = 8)
    private String job;

    @Column(name = "EDLEVEL", length = 30)
    private int educationLevel;

    @Column(length = 1)
    private char sex;

    @Column(precision = 12, scale = 2)
    private double salary;

    @Column(precision = 12, scale = 2)
    private double bonus;

    @Column(name = "COMM", precision = 12, scale = 2)
    private double commission;

    @OneToOne(cascade = CascadeType.ALL)
    private Address addr;

    @Temporal(TemporalType.DATE)
    private Date hiredate;

    @Temporal(TemporalType.DATE)
    private Date birthdate;

    public Employee(String firstName, String midInitial,
	    String lastName, String phoneNumber, String job,
	    int educationLevel, char sex, double salary, double bonus,
	    double commission, Address addr, Date hiredate, Date birthdate) {
	this.firstName = firstName;
	this.midInitial = midInitial;
	this.lastName = lastName;
	this.phoneNumber = phoneNumber;
	this.job = job;
	this.educationLevel = educationLevel;
	this.sex = sex;
	this.salary = salary;
	this.bonus = bonus;
	this.commission = commission;
	this.addr = addr;
	this.hiredate = hiredate;
	this.birthdate = birthdate;
    }

    public Employee() {
    }

    public long getEmpid() {
	return empid;
    }

    public void setEmpid(long empid) {
	this.empid = empid;
    }

    public String getEmpno() {
	return empno;
    }

    public void setEmpno(String empno) {
	this.empno = empno;
    }

    public String getFirstName() {
	return firstName;
    }

    public void setFirstName(String firstName) {
	this.firstName = firstName;
    }

    public String getMidInitial() {
	return midInitial;
    }

    public void setMidInitial(String midInitial) {
	this.midInitial = midInitial;
    }

    public String getLastName() {
	return lastName;
    }

    public void setLastName(String lastName) {
	this.lastName = lastName;
    }

    public String getPhoneNumber() {
	return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
	this.phoneNumber = phoneNumber;
    }

    public String getJob() {
	return job;
    }

    public void setJob(String job) {
	this.job = job;
    }

    public int getEducationLevel() {
	return educationLevel;
    }

    public void setEducationLevel(int educationLevel) {
	this.educationLevel = educationLevel;
    }

    public char getSex() {
	return sex;
    }

    public void setSex(char sex) {
	this.sex = sex;
    }

    public double getSalary() {
	return salary;
    }

    public void setSalary(double salary) {
	this.salary = salary;
    }

    public double getBonus() {
	return bonus;
    }

    public void setBonus(double bonus) {
	this.bonus = bonus;
    }

    public double getCommission() {
	return commission;
    }

    public void setCommission(double commission) {
	this.commission = commission;
    }

    public Address getAddr() {
	return addr;
    }

    public void setAddr(Address addr) {
	this.addr = addr;
    }

    public Date getHiredate() {
	return hiredate;
    }

    public void setHiredate(Date hiredate) {
	this.hiredate = hiredate;
    }

    public Date getBirthdate() {
	return birthdate;
    }

    public void setBirthdate(Date birthdate) {
	this.birthdate = birthdate;
    }

}
